package com.juzhi.dvrapp.activity;

import android.content.Intent;
import android.os.Handler;
import android.os.Message;

import com.juzhi.dvrapp.R;
import com.juzhi.dvrapp.service.BridgeService;
import com.juzhi.dvrapp.utils.MLog;

public class WelcomeActivity extends BaseAcitivity {

    private Handler handler = new Handler() {
        @Override
        public void handleMessage(Message msg) {
            super.handleMessage(msg);
            Intent intent = new Intent(WelcomeActivity.this, MainActivity.class);
            startActivity(intent);
            WelcomeActivity.this.finish();
        }
    };


    @Override
    public int getLayoutId() {
        return R.layout.activity_welcome;
    }

    @Override
    protected void initView() {
        //启动service
        Intent intent = new Intent(this, BridgeService.class);
        startService(intent);
        MLog.i("WelcomeActivity--->启动程序图标.....");

        handler.sendEmptyMessageDelayed(0, 2 * 1000);
    }
}
